package ae.pcfc.cldos.online.common.facade;

import java.util.ArrayList;
import java.util.List;

import org.dozer.DozerBeanMapper;

import ae.pcfc.cldos.online.common.clddb.domain.ReviewComments;
import ae.pcfc.cldos.online.common.vo.app.comments.ApplicationCommentVO;

public abstract class BaseFacade {
	
	protected DozerBeanMapper mapper;

	protected DozerBeanMapper getMapper() {
		return mapper;
	}

	public void setMapper(DozerBeanMapper mapper) {
		this.mapper = mapper;
	}
	
	protected List<ApplicationCommentVO> getCommentsVOList(List<ReviewComments> comments){
		List<ApplicationCommentVO> applicationCommentVOs = new ArrayList<ApplicationCommentVO>();
		if(comments!=null){
			for(ReviewComments reviewComments : comments){
				ApplicationCommentVO applicationCommentVO = new ApplicationCommentVO();
				applicationCommentVO.setApplicationStatus(reviewComments.getApplicationStatus().getStatusDesc());
				applicationCommentVO.setComment(reviewComments.getRcComments());
				applicationCommentVO.setUsername(reviewComments.getRcUserName());
				applicationCommentVO.setDate(reviewComments.getRcDate());
				applicationCommentVOs.add(applicationCommentVO);
			}
		}
		return applicationCommentVOs;
	}
}
